<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        class starts {
            constructor(uname, age) {
                this.uname = uname;
                this.age = age;
            }
            sing() {
                console.log("我的名字是" + this.uname);
                console.log("我今年有" + this.age);
            }
        }
        class son extends starts {
            constructor(uname, age) {
                super(uname, age);
                this.uname = uname;
                this.age = age;
            }
            super() {
                console.log("我的名字是" + this.uname + "我今年有" + this.age);
            }
        }
        var ldh = new son("刘德华", 18)
        ldh.sing()
        ldh.super()
    </script>
</body>

</html>